﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;

namespace System.Data.Linq.Mapping
{
    internal static class Error
    {
        // Methods
        internal static Exception AbstractClassAssignInheritanceDiscriminator(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.AbstractClassAssignInheritanceDiscriminator,p0));
        }

        internal static Exception ArgumentNull(string paramName)
        {
            return new ArgumentNullException(paramName);
        }

        internal static Exception ArgumentOutOfRange(string paramName)
        {
            return new ArgumentOutOfRangeException(paramName);
        }

        internal static Exception BadFunctionTypeInMethodMapping(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.BadFunctionTypeInMethodMapping,p0));
        }

        internal static Exception BadKeyMember(object p0, object p1, object p2)
        {
            return new InvalidOperationException(string.Format(Strings.BadKeyMember,p0, p1, p2));
        }

        internal static Exception BadStorageProperty(object p0, object p1, object p2)
        {
            return new InvalidOperationException(string.Format(Strings.BadStorageProperty,p0, p1, p2));
        }

        internal static Exception CannotGetInheritanceDefaultFromNonInheritanceClass()
        {
            return new InvalidOperationException(Strings.CannotGetInheritanceDefaultFromNonInheritanceClass);
        }

        internal static Exception CouldNotCreateAccessorToProperty(object p0, object p1, object p2)
        {
            return new ArgumentException(string.Format(Strings.CouldNotCreateAccessorToProperty,p0, p1, p2));
        }

        internal static Exception CouldNotFindElementTypeInModel(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.CouldNotFindElementTypeInModel,p0));
        }

        internal static Exception CouldNotFindRequiredAttribute(object p0, object p1)
        {
            return new XmlSchemaException(string.Format(Strings.CouldNotFindRequiredAttribute,p0, p1));
        }

        internal static Exception CouldNotFindRuntimeTypeForMapping(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.CouldNotFindRuntimeTypeForMapping,p0));
        }

        internal static Exception CouldNotFindTypeFromMapping(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.CouldNotFindTypeFromMapping,p0));
        }

        internal static Exception DatabaseNodeNotFound(object p0)
        {
            return new XmlSchemaException(string.Format(Strings.DatabaseNodeNotFound,p0));
        }

        internal static Exception DiscriminatorClrTypeNotSupported(object p0, object p1, object p2)
        {
            return new NotSupportedException(string.Format(Strings.DiscriminatorClrTypeNotSupported,p0, p1, p2));
        }

        internal static Exception EntityRefAlreadyLoaded()
        {
            return new InvalidOperationException(Strings.EntityRefAlreadyLoaded);
        }

        internal static Exception ExpectedEmptyElement(object p0, object p1, object p2)
        {
            return new XmlSchemaException(string.Format(Strings.ExpectedEmptyElement,p0, p1, p2));
        }

        internal static Exception IdentityClrTypeNotSupported(object p0, object p1, object p2)
        {
            return new NotSupportedException(string.Format(Strings.IdentityClrTypeNotSupported,p0, p1, p2));
        }

        internal static Exception IncorrectAutoSyncSpecification(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.IncorrectAutoSyncSpecification,p0));
        }

        internal static Exception IncorrectNumberOfParametersMappedForMethod(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.IncorrectNumberOfParametersMappedForMethod,p0));
        }

        internal static Exception InheritanceCodeMayNotBeNull()
        {
            return new InvalidOperationException(Strings.InheritanceCodeMayNotBeNull);
        }

        internal static Exception InheritanceCodeUsedForMultipleTypes(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.InheritanceCodeUsedForMultipleTypes,p0));
        }

        internal static Exception InheritanceHierarchyDoesNotDefineDefault(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.InheritanceHierarchyDoesNotDefineDefault,p0));
        }

        internal static Exception InheritanceSubTypeIsAlsoRoot(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.InheritanceSubTypeIsAlsoRoot,p0));
        }

        internal static Exception InheritanceTypeDoesNotDeriveFromRoot(object p0, object p1)
        {
            return new InvalidOperationException(string.Format(Strings.InheritanceTypeDoesNotDeriveFromRoot,p0, p1));
        }

        internal static Exception InheritanceTypeHasMultipleDefaults(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.InheritanceTypeHasMultipleDefaults,p0));
        }

        internal static Exception InheritanceTypeHasMultipleDiscriminators(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.InheritanceTypeHasMultipleDiscriminators,p0));
        }

        internal static Exception InvalidDeleteOnNullSpecification(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.InvalidDeleteOnNullSpecification,p0));
        }

        internal static Exception InvalidFieldInfo(object p0, object p1, object p2)
        {
            return new ArgumentException(string.Format(Strings.InvalidFieldInfo,p0, p1, p2));
        }

        internal static Exception InvalidUseOfGenericMethodAsMappedFunction(object p0)
        {
            return new NotSupportedException(string.Format(Strings.InvalidUseOfGenericMethodAsMappedFunction,p0));
        }

        internal static Exception LinkAlreadyLoaded()
        {
            return new InvalidOperationException(Strings.LinkAlreadyLoaded);
        }

        internal static Exception MappedMemberHadNoCorrespondingMemberInType(object p0, object p1)
        {
            return new NotSupportedException(string.Format(Strings.MappedMemberHadNoCorrespondingMemberInType,p0, p1));
        }

        internal static Exception MappingForTableUndefined(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.MappingForTableUndefined,p0));
        }

        internal static Exception MappingOfInterfacesMemberIsNotSupported(object p0, object p1)
        {
            return new NotSupportedException(string.Format(Strings.MappingOfInterfacesMemberIsNotSupported,p0, p1));
        }

        internal static Exception MemberMappedMoreThanOnce(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.MemberMappedMoreThanOnce,p0));
        }

        internal static Exception MethodCannotBeFound(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.MethodCannotBeFound,p0));
        }

        internal static Exception MismatchedThisKeyOtherKey(object p0, object p1)
        {
            return new InvalidOperationException(string.Format(Strings.MismatchedThisKeyOtherKey,p0, p1));
        }

        internal static Exception NoDiscriminatorFound(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.NoDiscriminatorFound,p0));
        }

        internal static Exception NonInheritanceClassHasDiscriminator(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.NonInheritanceClassHasDiscriminator,p0));
        }

        internal static Exception NoResultTypesDeclaredForFunction(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.NoResultTypesDeclaredForFunction,p0));
        }

        internal static Exception NotImplemented()
        {
            return new NotImplementedException();
        }

        internal static Exception NotSupported()
        {
            return new NotSupportedException();
        }

        internal static Exception PrimaryKeyInSubTypeNotSupported(object p0, object p1)
        {
            return new NotSupportedException(string.Format(Strings.PrimaryKeyInSubTypeNotSupported,p0, p1));
        }

        internal static Exception ProviderTypeNotFound(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.ProviderTypeNotFound,p0));
        }

        internal static Exception TooManyResultTypesDeclaredForFunction(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.TooManyResultTypesDeclaredForFunction,p0));
        }

        internal static Exception TwoMembersMarkedAsInheritanceDiscriminator(object p0, object p1)
        {
            return new InvalidOperationException(string.Format(Strings.TwoMembersMarkedAsInheritanceDiscriminator,p0, p1));
        }

        internal static Exception TwoMembersMarkedAsPrimaryKeyAndDBGenerated(object p0, object p1)
        {
            return new InvalidOperationException(string.Format(Strings.TwoMembersMarkedAsPrimaryKeyAndDBGenerated,p0, p1));
        }

        internal static Exception TwoMembersMarkedAsRowVersion(object p0, object p1)
        {
            return new InvalidOperationException(string.Format(Strings.TwoMembersMarkedAsRowVersion,p0, p1));
        }

        internal static Exception UnableToAssignValueToReadonlyProperty(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.UnableToAssignValueToReadonlyProperty,p0));
        }

        internal static Exception UnableToResolveRootForType(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.UnableToResolveRootForType,p0));
        }

        internal static Exception UnexpectedElement(object p0, object p1)
        {
            return new XmlSchemaException(string.Format(Strings.UnexpectedElement,p0, p1));
        }

        internal static Exception UnexpectedNull(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.UnexpectedNull,p0));
        }

        internal static Exception UnhandledDeferredStorageType(object p0)
        {
            return new InvalidOperationException(string.Format(Strings.UnhandledDeferredStorageType,p0));
        }

        internal static Exception UnmappedClassMember(object p0, object p1)
        {
            return new InvalidOperationException(string.Format(Strings.UnmappedClassMember,p0, p1));
        }

        internal static Exception UnrecognizedAttribute(object p0)
        {
            return new XmlSchemaException(string.Format(Strings.UnrecognizedAttribute,p0));
        }

        internal static Exception UnrecognizedElement(object p0)
        {
            return new XmlSchemaException(string.Format(Strings.UnrecognizedElement,p0));
        }
    }
}
